home *** CD-ROM | disk | FTP | other *** search
/ Champak 128 / Vol 128 (Damaged).iso / games / hello_ki.swf / scripts / DefineButton2_27 / BUTTONCONDACTION on(release).as
Encoding:
Text File  |  2011-03-26  |  1.8 KB  |  61 lines

  1. on(release){
  2.    if(_parent.PlayingGame)
  3.    {
  4.       if(_parent.CurrentFlipsCount < 999)
  5.       {
  6.          if(!CardMotion.out)
  7.          {
  8.             _parent.CurrentFlipsCount = _parent.CurrentFlipsCount + 1;
  9.             _parent.CurrentFlips = "FLIPS: " + _parent.CurrentFlipsCount;
  10.             if(_parent.NoOfCardsOut == 0)
  11.             {
  12.                tellTarget("CardMotion")
  13.                {
  14.                   gotoAndStop("SpinFront");
  15.                   play();
  16.                }
  17.                _parent.NoOfCardsOut = 1;
  18.                _parent.FirstCard = _parent.cardArray[ThisCardNumber - 1];
  19.                _parent.FirstCardName = this._name;
  20.             }
  21.             else if(_parent.NoOfCardsOut == 1)
  22.             {
  23.                tellTarget("CardMotion")
  24.                {
  25.                   gotoAndStop("SpinFront");
  26.                   play();
  27.                }
  28.                _parent.NoOfCardsOut = 2;
  29.                _parent.SecondCard = _parent.cardArray[ThisCardNumber - 1];
  30.                _parent.SecondCardName = this._name;
  31.                if(_parent.CurrentPairsCount == 11)
  32.                {
  33.                   gotoAndStop("HideCards");
  34.                   play();
  35.                }
  36.                else
  37.                {
  38.                   gotoAndStop("ShowCards");
  39.                   play();
  40.                }
  41.             }
  42.             else if(_parent.NoOfCardsOut == 2)
  43.             {
  44.                tellTarget("_parent." + _parent.SecondCardName)
  45.                {
  46.                   gotoAndStop("DoNothing");
  47.                }
  48.                _parent.NoOfCardsOut = 3;
  49.                gotoAndStop("HideCards");
  50.                play();
  51.             }
  52.          }
  53.       }
  54.       else
  55.       {
  56.          _parent.GameOverPage = "ExcessFlips";
  57.          _parent.gotoAndStop("GameOver");
  58.       }
  59.    }
  60. }
  61.